<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php
?>
<?php include("../3-includes/settings.php"); ?>
<script src="<?php echo $domain; ?>/jquery.js"></script>
<script src="<?php echo $domain; ?>/input-placeholder-text.js"></script>
<style>
	.placeholder {
		color: #6D6D6D;
	}
</style>

<script type="text/javascript" src="center.js"></script>
		</script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Login to <?php echo $name; ?></title>
<link rel="stylesheet" type="text/css" href="admin.css"/>
</head>

<body>
<div class="wrap" id="content">
<h2>Login to <?php echo $name; ?></h2>
<div id="login">
<form method="post">
 <table>
<tr><td><input placeholder="username" id="search-text" type="text" name="username" /></td></tr>
<tr><td><input placeholder="password" type="password" name="password" /></td></tr>
<tr><td><input type="submit" name="submit" value="login" /></td></tr>
<?php
if (isset($_POST['submit'])) {
	$username = $_POST['username'];
    $password = md5($_POST['password']);
    $query = mysql_query("SELECT * FROM `$usersTable` WHERE `username`='$username' and `password`='$password'");
    $num = mysql_num_rows($query);
    if ($num == 0) {
     echo "<tr><td>Invalid username and/or password</tr></td>";
    } else {
    	setcookie("authd","true");
        header("Location: index.php");
    }
}
?>
</table>
</form>
</div>
</div>
</body>
</html>
